<template>
  <div>
    <silent-index v-if="type == 'silent'" @menu-select="selectType" :typeKey="typeKey"></silent-index>
    <submit-index v-if="type == 'submit'" @menu-select="selectType" :typeKey="typeKey"></submit-index>
    <delete-index v-if="type == 'delete'" @menu-select="selectType" :typeKey="typeKey"></delete-index>
  </div>
</template>

<script>
import SilentIndex from './SilentCustomer'
import SubmitIndex from './SubmitCustomer'
import DeleteIndex from './DeleteCustomer'
import { mapGetters } from 'vuex'
export default {
  name: 'CustomerAllIndex',
  components: {
    SilentIndex,
    SubmitIndex,
    DeleteIndex
  },
  props: {},
  data() {
    return {
      type: 'submit',
      typeKey: ['submit'],
      componentName: '',
    }
  },
  computed: {},
  watch: {},
  mounted() {},

  beforeDestroy() {},
  methods: {
    selectType(e) {
      this.typeKey = e.keyPath
      if (e.key == 'silent') {
        this.type = 'silent'
      } else if (e.key == 'submit') {
        this.type = 'submit'
      } else {
        this.type = 'delete'
      }
    },
  },
}
</script>

<style lang="scss" scoped>
</style>
